# Defines the settings, challenges, log and scores DB values 

import os
from sqlobject import *

from settings import settingsTable
from log import logTable, log


from scores import  challengeTable, \
                    voteVal, \
                    voteTable, \
                    userTable




settingsDB = os.path.abspath( 'dpc.db' )
scoresDB = os.path.abspath( 'scores.db' )
logDB = os.path.abspath( 'log.db' )



sqlhub.processConnection = connectionForURI( 'sqlite:./dpchallenge.db' )






def validateDBs():
  settingsTable.createTable( ifNotExists = True );

  logTable.createTable( ifNotExists = True )

  challengeTable.createTable( ifNotExists = True );
  voteTable.createTable( ifNotExists = True )
  userTable.createTable( ifNotExists = True )



